#ifndef __FLASH__
#define __FLASH__

#ifdef __cplusplus
extern "C"
{
#endif
#ifdef CH32
#include "ch32v30x_flash.h"
#endif
#ifdef AT32
#include "at32f403a_407_flash.h"
#endif
#ifdef STM32
#include "main.h"
#endif
#include "stdio.h"
#include "memory.h"
#ifdef __cplusplus
}
#endif
#define FALSH_CALIBRATE_ADDR 0x0800
class Flash
{
private:
    const uint32_t FLASH_START_ADDR_BASE = 0x08030000;
    uint32_t FLASH_START_ADDR;
public:
    Flash();
    Flash(uint32_t offset);
    ~Flash();
    uint8_t ReadConfig(uint32_t *setting,uint8_t size);
    uint8_t SaveConfig(uint32_t *setting,uint8_t size);
    void EraseConfig();
    static void Clean_Flash_Key_Reset();
};


#endif